In graph theory, graph coloring is a methodic assignment of labels traditionally called "colors" to elements of a graph. The assignment is subject to certain constraints, such as that no two adjacent elements have the same color. Graph coloring is a special case of graph labeling. In its simplest form, it is a way of coloring the vertices of a graph such that no two adjacent vertices are of the same color; this is called a vertex coloring. Similarly, an edge coloring assigns a color to each edge so that no two adjacent edges are of the same color, and a face coloring of a planar graph assigns a color to each face (or region) so that no two faces that share a boundary have the same color.
Vertex coloring is often used to introduce graph coloring problems, since other coloring problems can be transformed into a vertex coloring instance. For example, an edge coloring of a graph is just a vertex coloring of its line graph, and a face coloring of a plane graph is just a vertex coloring of its dual graph. However, non-vertex coloring problems are often stated and studied as-is. This is partly Pedagogy, and partly because some problems are best studied in their non-vertex form, as in the case of edge coloring.
The convention of using colors originates from coloring the countries in a political map, where each face is literally colored. This was generalized to coloring the faces of a graph Graph embedding in the plane. By planar duality it became coloring the vertices, and in this form it generalizes to all graphs. In mathematical and computer representations, it is typical to use the first few positive or non-negative integers as the "colors". In general, one can use any finite set as the "color set". The nature of the coloring problem depends on the number of colors but not on what they are.
Graph coloring enjoys many practical applications as well as theoretical challenges. Beside the classical types of problems, different limitations can also be set on the graph, or on the way a color is assigned, or even on the color itself. It has even reached popularity with the general public in the form of the popular number puzzle Sudoku. Graph coloring is still a very active field of research.
In 1890, Percy John Heawood pointed out that Kempe's argument was wrong. However, in that paper he proved the five color theorem, saying that every planar map can be colored with no more than five colors, using ideas of Kempe. In the following century, a vast amount of work was done and theories were developed to reduce the number of colors to four, until the four color theorem was finally proved in 1976 by Kenneth Appel and Wolfgang Haken. The proof went back to the ideas of Heawood and Kempe and largely disregarded the intervening developments. The proof of the four color theorem is noteworthy, aside from its solution of a century-old problem, for being the first major computer-aided proof.
In 1912, George David Birkhoff introduced the chromatic polynomial to study the coloring problem, which was generalised to the Tutte polynomial by W. T. Tutte, both of which are important invariants in algebraic graph theory. Kempe had already drawn attention to the general, non-planar case in 1879, and many results on generalisations of planar graph coloring to surfaces of higher order followed in the early 20th century.
In 1960, Claude Berge formulated another conjecture about graph coloring, the strong perfect graph conjecture, originally motivated by an information-theoretic concept called the zero-error capacity of a graph introduced by Claude Shannon. The conjecture remained unresolved for 40 years, until it was established as the celebrated strong perfect graph theorem by Maria Chudnovsky, Robertson, Seymour, and Thomas in 2002.
Graph coloring has been studied as an algorithmic problem since the early 1970s: the chromatic number problem (see section below) is one of Karp's 21 NP-complete problems from 1972, and at approximately the same time various exponential-time algorithms were developed based on backtracking and on the deletion-contraction recurrence of . One of the major applications of graph coloring, register allocation in compilers, was introduced in 1981.
The terminology of using colors for vertex labels goes back to map coloring. Labels like red and blue are only used when the number of colors is small, and normally it is understood that the labels are drawn from the .
A coloring using at most colors is called a (proper) -coloring. The smallest number of colors needed to color a graph is called its chromatic number, and is often denoted . Sometimes is used, since is also used to denote the Euler characteristic of a graph. A graph that can be assigned a (proper) -coloring is -colorable, and it is -chromatic if its chromatic number is exactly . A subset of vertices assigned to the same color is called a color class; every such class forms an independent set. Thus, a -coloring is the same as a partition of the vertex set into independent sets, and the terms -partite and -colorable have the same meaning.
The chromatic polynomial is a function that counts the number of -colorings of . As the name indicates, for a given the function is indeed a polynomial in . For the example graph, , and indeed .
The chromatic polynomial includes more information about the colorability of than does the chromatic number. Indeed, is the smallest positive integer that is not a zero of the chromatic polynomial .
+Chromatic polynomials for certain graphs |
If we interpret a coloring of a graph on vertices as a vector in , the action of an automorphism is a permutation of the coefficients in the coloring vector.
The only graphs that can be 1-colored are . A complete graph of n vertices requires colors. In an optimal coloring there must be at least one of the graph's m edges between every pair of color classes, so
More generally a family of graphs is -bounded if there is some function such that the graphs in can be colored with at most colors, where is the clique number of . For the family of the perfect graphs this function is .
The 2-colorable graphs are exactly the , including trees and forests. By the four color theorem, every planar graph can be 4-colored.
A greedy coloring shows that every graph can be colored with one more color than the maximum vertex degree,
Complete graphs have and , and have and , so for these graphs this bound is best possible. In all other cases, the bound can be slightly improved; Brooks' theorem states that
If G contains a clique of size k, then at least k colors are needed to color that clique; in other words, the chromatic number is at least the clique number:
For this bound is tight. Finding cliques is known as the clique problem.
Hoffman's bound: Let be a real symmetric matrix such that whenever is not an edge in . Define , where are the largest and smallest eigenvalues of . Define , with as above. Then:
: Let be a positive semi-definite matrix such that whenever is an edge in . Define to be the least k for which such a matrix exists. Then
Lovász number: The Lovász number of a complementary graph is also a lower bound on the chromatic number:
Fractional chromatic number: The fractional chromatic number of a graph is a lower bound on the chromatic number as well:
These bounds are ordered as follows:
To prove this, both, Mycielski and Zykov, each gave a construction of an inductively defined family of triangle-free graphs but with arbitrarily large chromatic number. constructed axis aligned boxes in whose intersection graph is triangle-free and requires arbitrarily many colors to be properly colored. This family of graphs is then called the Burling graphs. The same class of graphs is used for the construction of a family of triangle-free line segments in the plane, given by Pawlik et al. (2014). It shows that the chromatic number of its intersection graph is arbitrarily large as well. Hence, this implies that axis aligned boxes in as well as line segments in are not χ-bounded.
From Brooks's theorem, graphs with high chromatic number must have high maximum degree. But colorability is not an entirely local phenomenon: A graph with high girth looks locally like a tree, because all cycles are long, but its chromatic number need not be 2:
There is a strong relationship between edge colorability and the graph's maximum degree . Since all edges incident to the same vertex need their own color, we have
Moreover,
In general, the relationship is even stronger than what Brooks's theorem gives for vertex coloring:
For planar graphs, vertex colorings are essentially dual to nowhere-zero flows.
About infinite graphs, much less is known. The following are two of the few results about infinite graph coloring:
The chromatic number of the plane, where two points are adjacent if they have unit distance, is unknown, although it is one of 5, 6, or 7. Other open problems concerning the chromatic number of graphs include the Hadwiger conjecture stating that every graph with chromatic number k has a complete graph on k vertices as a graph minor, the Erdős–Faber–Lovász conjecture bounding the chromatic number of unions of complete graphs that have at most one vertex in common to each pair, and the Albertson conjecture that among k-chromatic graphs the complete graphs are the ones with smallest crossing number.
When Birkhoff and Lewis introduced the chromatic polynomial in their attack on the four-color theorem, they conjectured that for planar graphs G, the polynomial has no zeros in the region . Although it is known that such a chromatic polynomial has no zeros in the region and that , their conjecture is still unresolved. It also remains an unsolved problem to characterize graphs which have the same chromatic polynomial and to determine which polynomials are chromatic.
If the graph is planar and has low branch-width (or is nonplanar but with a known branch-decomposition), then it can be solved in polynomial time using dynamic programming. In general, the time required is polynomial in the graph size, but exponential in the branch-width.
Using dynamic programming and a bound on the number of maximal independent sets, k-colorability can be decided in time and space . Using the principle of inclusion–exclusion and Frank Yates's algorithm for the fast zeta transform, k-colorability can be decided in time for any k. Faster algorithms are known for 3- and 4-colorability, which can be decided in time and , respectively. Exponentially faster algorithms are also known for 5- and 6-colorability, as well as for restricted families of graphs, including sparse graphs.
The chromatic number satisfies the recurrence relation:
The chromatic polynomial satisfies the following recurrence relation
These expressions give rise to a recursive procedure called the deletion–contraction algorithm, which forms the basis of many algorithms for graph coloring. The running time satisfies the same recurrence relation as the Fibonacci numbers, so in the worst case the algorithm runs in time within a polynomial factor of for n vertices and m edges. The analysis can be improved to within a polynomial factor of the number of spanning trees of the input graph. In practice, branch and bound strategies and isomorphism rejection are employed to avoid some recursive calls. The running time depends on the heuristic used to pick the vertex pair.
For , and for special cases of chordal graphs such as and indifference graphs, the greedy coloring algorithm can be used to find optimal colorings in polynomial time, by choosing the vertex ordering to be the reverse of a perfect elimination ordering for the graph. The perfectly orderable graphs generalize this property, but it is NP-hard to find a perfect ordering of these graphs.
If the vertices are ordered according to their degrees, the resulting greedy coloring uses at most colors, at most one more than the graph's maximum degree. This heuristic is sometimes called the Welsh–Powell algorithm. Another heuristic due to Brélaz establishes the ordering dynamically while the algorithm proceeds, choosing next the vertex adjacent to the largest number of different colors. Many other graph coloring heuristics are similarly based on greedy coloring for a specific static or dynamic strategy of ordering the vertices, these algorithms are sometimes called sequential coloring algorithms.
The maximum (worst) number of colors that can be obtained by the greedy algorithm, by using a vertex ordering chosen to maximize this number, is called the Grundy number of a graph.
Similarly to the Greedy coloring, DSatur colours the vertices of a graph one after another, expending a previously unused colour when needed. Once a new vertex has been coloured, the algorithm determines which of the remaining uncoloured vertices has the highest number of different colours in its neighbourhood and colours this vertex next. This is defined as the degree of saturation of a given vertex.
The recursive largest first algorithm operates in a different fashion by constructing each color class one at a time. It does this by identifying a maximal independent set of vertices in the graph using specialised heuristic rules. It then assigns these vertices to the same color and removes them from the graph. These actions are repeated on the remaining subgraph until no vertices remain.
The worst-case complexity of DSatur is , where is the number of vertices in the graph. The algorithm can also be implemented using a binary heap to store saturation degrees, operating in where is the number of edges in the graph. This produces much faster runs with sparse graphs. The overall complexity of RLF is slightly higher than DSatur at .
DSatur and RLF are Exact algorithm for bipartite graph, cycle graph, and .
In the field of distributed algorithms, graph coloring is closely related to the problem of symmetry breaking. The current state-of-the-art randomized algorithms are faster for sufficiently large maximum degree Δ than deterministic algorithms. The fastest randomized algorithms employ the multi-trials technique by Schneider and Wattenhofer.
In a symmetric graph, a deterministic distributed algorithm cannot find a proper vertex coloring. Some auxiliary information is needed in order to break symmetry. A standard assumption is that initially each node has a unique identifier, for example, from the set . Put otherwise, we assume that we are given an n-coloring. The challenge is to reduce the number of colors from n to, e.g., Δ + 1. The more colors are employed, e.g. O(Δ) instead of Δ + 1, the fewer communication rounds are required.
A straightforward distributed version of the greedy algorithm for (Δ + 1)-coloring requires Θ( n) communication rounds in the worst case – information may need to be propagated from one side of the network to another side.
The simplest interesting case is an n-cycle graph. Richard Cole and Uzi Vishkin, see also . show that there is a distributed algorithm that reduces the number of colors from n to O(log n) in one synchronous communication step. By iterating the same procedure, it is possible to obtain a 3-coloring of an n-cycle in O( n) communication steps (assuming that we have unique node identifiers).
The function , iterated logarithm, is an extremely slowly growing function, "almost constant". Hence the result by Cole and Vishkin raised the question of whether there is a constant-time distributed algorithm for 3-coloring an n-cycle. showed that this is not possible: any deterministic distributed algorithm requires Ω( n) communication steps to reduce an n-coloring to a 3-coloring in an n-cycle.
The technique by Cole and Vishkin can be applied in arbitrary bounded-degree graphs as well; the running time is poly(Δ) + O( n). The technique was extended to unit disk graphs by Schneider and Wattenhofer. The fastest deterministic algorithms for (Δ + 1)-coloring for small Δ are due to Leonid Barenboim, Michael Elkin and Fabian Kuhn.; . The algorithm by Barenboim et al. runs in time O(Δ) + ( n)/2, which is optimal in terms of n since the constant factor 1/2 cannot be improved due to Linial's lower bound. use network decompositions to compute a Δ+1 coloring in time .
The problem of edge coloring has also been studied in the distributed model. achieve a (2Δ − 1)-coloring in O(Δ + n) time in this model. The lower bound for distributed vertex coloring due to applies to the distributed edge coloring problem as well.
The best known approximation algorithm computes a coloring of size at most within a factor O( n(log log n)2(log n)−3) of the chromatic number. For all ε > 0, approximating the chromatic number within n1− ε is NP-hard.
It is also NP-hard to color a 3-colorable graph with 5 colors, 4-colorable graph with 7 colours, and a k-colorable graph with colors for k ≥ 5.
Computing the coefficients of the chromatic polynomial is Sharp-P-complete. In fact, even computing the value of is #P-hard at any rational point k except for k = 1 and k = 2. There is no FPRAS for evaluating the chromatic polynomial at any rational point k ≥ 1.5 except for k = 2 unless NP = RP.
For edge coloring, the proof of Vizing's result gives an algorithm that uses at most Δ+1 colors. However, deciding between the two candidate values for the edge chromatic number is NP-complete. In terms of approximation algorithms, Vizing's algorithm shows that the edge chromatic number can be approximated to within 4/3, and the hardness result shows that no (4/3 − ε)-algorithm exists for any ε > 0 unless P = NP. These are among the oldest results in the literature of approximation algorithms, even though neither paper makes explicit use of that notion.
Details of the scheduling problem define the structure of the graph. For example, when assigning aircraft to flights, the resulting conflict graph is an interval graph, so the coloring problem can be solved efficiently. In bandwidth allocation to radio stations, the resulting conflict graph is a unit disk graph, so the coloring problem is 3-approximable.
The textbook approach to this problem is to model it as a graph coloring problem. The compiler constructs an interference graph, where vertices are variables and an edge connects two vertices if they are needed at the same time. If the graph can be colored with k colors then any set of variables needed at the same time can be stored in at most k registers.
Let be a number of colors where is the set of integers modulo k consisting of the elements (or colors) . First, we color each vertex in G using the elements of , allowing two adjacent vertices to be assigned the same color. In other words, we want c to be a coloring such that c: V(G) → where adjacent vertices can be assigned the same color.
For each vertex v in G, the color sum of , is the sum of all of the adjacent vertices to v mod k. The color sum of v is denoted by
where u is an arbitrary vertex in the neighborhood of v, N(v). We then color each vertex with the new coloring determined by the sum of the adjacent vertices. The graph G has a modular k-coloring if, for every pair of adjacent vertices a,b, σ(a) ≠ σ(b). The modular chromatic number of G, mc(G), is the minimum value of k such that there exists a modular k-coloring of G.<
For example, let there be a vertex v adjacent to vertices with the assigned colors 0, 1, 1, and 3 mod 4 (k=4). The color sum would be σ(v) = 0 + 1 + 1+ 3 mod 4 = 5 mod 4 = 1. This would be the new color of vertex v. We would repeat this process for every vertex in G. If two adjacent vertices have equal color sums, G does not have a modulo 4 coloring. If none of the adjacent vertices have equal color sums, G has a modulo 4 coloring.
Coloring can also be considered for and .
|
|